package com.lc.listdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private ListView list_view;
    ListViewDemoAdapter listViewDemoAdapter;
    private List<String> mdatas;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        list_view= (ListView) findViewById(R.id.list_view);
        mdatas=new ArrayList<>();
        for (int i=0;i<10;i++){
            mdatas.add("heheda"+i);

        }
        listViewDemoAdapter=new ListViewDemoAdapter(MainActivity.this,mdatas);
        list_view.setAdapter(listViewDemoAdapter);

    }
}
